﻿using mozhi.smarterp.Finance.Ieps.Import;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace mozhi.smarterp.Finance.Ieps
{
    public class ImportAppService : FinanceAppService, IImportAppService
    {
        private IServiceProvider _serviceProvider;
        public ImportAppService(IServiceProvider serviceProvider) 
        { 
            _serviceProvider = serviceProvider;
        }

        public Task<ImportResultDto> ImportAsync(string moduleCode, Guid fieldId)
        {
            var importHandler = ImportHandlerFactory.Instance(moduleCode, _serviceProvider);

            var result = importHandler.HandleImportData(fieldId);

            return result;
        }
    }
}
